<?php
namespace  app\model;

use think\Model;
use bingher\sms\AliSms as sms;
class AliSMS extends Model{
  private $config = [
    'host' => 'dysmsapi.aliyuncs.com',
    'scheme' => 'http',
    'region_id' => 'cn-hangzhou',
    'access_key' => 'LTAI4Fu2aShN6rsJVWHYdwjA',
    'access_secret' => 'zQv5pEhlexzvWKuKNAh6Q54qC33Dcj',
    'product' => '豌豆电商',
    'actions' => [
        'register' => [
            'sign_name' => '豌豆电商',
            'template_code' => 'SMS_67105498',
            'template_param' => [
                'code' => '',
                'product' => '',
            ]
        ],
        'login' => [
            'sign_name' => '豌豆电商',
            'template_code' => 'SMS_176390064',
            'template_param' => [
                'code' => '',
            ]
        ],
        'changepass' => [
            'sign_name' => '豌豆电商',
            'template_code' => 'SMS_178535220',
            'template_param' => [
                'code' => '',
            ]
        ],
    ],
];

  public function send($phone= '',$type,$param){
    $sms = new sms($this->config);
    return $result =   call_user_func([$sms,$type],$phone,$param);

  }
}

 ?>
